<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="included/commons.jsp"%>
<title>
文档浏览器
</title>

</head>
<%
/*
    String ServerIP = request.getServerName();
    String sPageName = "viewattach.jsp";
	String sHost =  request.getHeader("Host");
	String sRAdd = request.getRequestURI(); 
		   sRAdd = sRAdd.substring(0,sRAdd.length()-sPageName.length());
	String BaseUrl = "Http://" + sHost + sRAdd;
*/
%>
<body onload="soaOpen();window.focus();" onunload="soaClose();">
<script language="javascript">
	var bDocOpen = false;
	//alert(model);
	function soaOpen() 
	{ 
	    // alert(action);
		try {
			//formData.SOAOfficeCtrl.SaveDocURL = "usedoc?action=save&wid=${param.wid}";    
			formData.SOAOfficeCtrl.WebOpen("tempdoc/${filename}",0,"${loginuser.localName}","Excel.Sheet");  		
		}
		catch (e)
		{
		   
           alert("打开文档失败 \n消息: "+e.message);
		}
	} 
	function soaClose()
	{
		try {
			if (bDocOpen)
				formData.SOAOfficeCtrl.Close();
			return true; 
		} 
		catch (e) 
		{ 
			alert("关闭文档失败!\n错误信息："+e.message); 
			return false; 
		} 
	}
</script>
<SCRIPT language="JavaScript" event="OnDocumentOpened(str, obj)"
	for="SOAOfficeCtrl">
			bDocOpen = true;
		</SCRIPT>
<SCRIPT language="JavaScript" event="OnDocumentClosed()"
	for="SOAOfficeCtrl">
			bDocOpen = false;
		</SCRIPT>
<form name="formData" method="post" id="formData">
<%@include file="soaobject.jsp"%></form>
</body>
</html>
